# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Ilya Elenskiy <elenskiy.ilya@gmail.com>
# Contributor: Julien Nicoulaud <julien.nicoulaud@gmail.com>

pkgname=python-rx
pkgver=3.2.0
pkgrel=4
pkgdesc='Reactive Extensions for Python'
arch=(any)
url=http://reactivex.io
license=(APACHE)
depends=(python)
makedepends=(
  git
  python-setuptools
)
checkdepends=(
  python-coverage
  python-nose
  python-pytest
  python-pytest-asyncio
)
_tag=5054de8874f275ed0de55007b87cff4817b1d9f7
source=(
  git+https://github.com/ReactiveX/RxPY.git#tag=${_tag}
  python-rx-py311.patch
)
b2sums=('SKIP'
        '3062891dcdfec9ad21ec6815aa1f83ad6b898de32339c02cef9369a975719a1d58ab7bb07cc352829264b20bfd9a710905c96cc3b88c31b157ba1336dc77271d')

pkgver() {
  cd RxPY
  git describe --tags | sed 's/^v//'
}

prepare() {
  cd RxPY
  # Remove deprecated loop parameter (#575)
  # https://github.com/ReactiveX/RxPY/pull/575
  git format-patch -1 --stdout 246eabfefd17 | patch -Np1
  patch -Np1 -i ../python-rx-py311.patch
}

build() {
  cd RxPY
  python setup.py build
}

check() {
  cd RxPY
  python -m pytest
}

package() {
  cd RxPY
  python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
}

# vim: ts=2 sw=2 et:
